<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>List Customer</title>
    <meta name="layout" content="main">
  </head>
  <body>
    <br>
    <g:link class="list" action="newRepairShop">
      <div class="tabNoSelected">
        Repair Shop
      </div>
    </g:link>
  
    <g:link class="list" action="newCustomer">
      <div class="tabSelected">
        Customer
      </div>
    </g:link>
  
    <g:link class="list" action="newMechanicalTechnician">
      <div class="tabNoSelected">
        Mechanical Technician
      </div>
    </g:link>
  
    <g:link class="list" action="newVehicle">
      <div class="tabNoSelected">
        Vehicle
      </div>
    </g:link>
  
    <g:link class="list" action="logout" controller="LogIn">
      <div class="tabNoSelected">Log Out</div>
    </g:link>
  
    <div class="tabContent"> 
      <g:link class="list" action="newCustomer" >
        <div class="tabNoSelected">
          New
        </div>
      </g:link>
      <g:link class="list" action="listCustomer" >
        <div class="tabSelected">
          List
        </div>
      </g:link>
    </div>
    <hr>
    
    <table >
				<thead>
					<tr>
                                                
                                                <th><g:message code= "customer.email.label" default="Email" /></th>
                                                <th><g:message code= "customer.name.label" default="Name" /></th>
						<th><g:message code= "customer.address.label" default="Address" /></th>
                                                
						<th><g:message code= "customer.phoneNumber.label" default="Phone Number" /></th>
						<th><g:message code= "customer.identification.label" default="Identification" /></th>
                                                
                                                <th><g:message code="customer.repairShop.label" default="Repair Shop" /></th>
                                                
					</tr>
				</thead>
				<tbody>
				<g:each in="${customerInstanceList}" status="i" var="customerInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
						<td><g:link action="editCustomer" id="${customerInstance.id}">${fieldValue(bean: customerInstance, field: "email")}</g:link></td>
					
						<td>${fieldValue(bean: customerInstance, field: "name")}</td>
					
						<td>${fieldValue(bean: customerInstance, field: "address")}</td>
					
						<td>${fieldValue(bean: customerInstance, field: "phoneNumber")}</td>
					
						
					
						<td>${fieldValue(bean: customerInstance, field: "identification")}</td>
					
                                                
                                                <td>${fieldValue(bean: customerInstance, field: "repairShop.name")}</td>
					</tr>
				</g:each>
				</tbody>
			</table>
  </body>
</html>
